<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateConfigTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('config', function (Blueprint $table) {
            $table->increments('id');
            $table->string('module')->default('admin')->comment('应用模块');
            $table->string('name')->nullable()->comment('变量名');
            $table->string('group')->nullable()->comment('分组');
            $table->string('title')->nullable()->comment('变量标题');
            $table->string('tip')->nullable()->comment('变量描述');
            $table->string('type')->nullable()->comment('类型');
            $table->text('value')->nullable()->comment('变量值');
            $table->text('content')->nullable()->comment('变量字典数据');
            $table->string('rule')->nullable()->comment('验证规则');
            $table->string('extend')->nullable()->comment('扩展属性');
            $table->string('setting')->nullable()->comment('配置');
            $table->tinyInteger('required')->comment('是否必填，0=否，1=是')->default(0);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('config');
    }
}
